﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;


namespace HobSoft.SoccerBet2014.Domain.Models
{
    using Core;
    [Serializable]
    [DataContract]
    public class BFAccount : IModel
    {
        private string _account;
        [PrimaryKey]
        [Key]
        [Required]
        [DataMember(IsRequired = true)]
        [MaxLength(50)]
        [MinLength(1)]
        public string Account
        {
            get { return _account; }
            set { _account = value; }
        }

        private string _password;
        [Required]
        [DataMember(IsRequired = true)]
        [MaxLength(50)]
        [MinLength(1)]
        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }

        private string _session;
        [DataMember(IsRequired = true)]
        [MaxLength(200)]
        [MinLength(1)]
        public string Session
        {
            get { return _session; }
            set { _session = value; }
        }

        private string _appKey;
        [DataMember(IsRequired = true)]
        [MaxLength(50)]
        [MinLength(1)]
        public string AppKey
        {
            get { return _appKey; }
            set { _appKey = value; }
        }


        private BFAccountUsage _usage;
        [DataMember(IsRequired = true)]
        [Required]
        public BFAccountUsage Usage
        {
            get { return _usage; }
            set { _usage = value; }
        }

        private string _certificateFile;
        [DataMember()]
        [MaxLength(250)]
        public string CertificateFile
        {
            get
            {
                return _certificateFile;
            }
            set
            {
                _certificateFile = value;
            }
        }

        private decimal _discount;
        [DataMember]
        public decimal Discount
        {
            get { return _discount; }
            set { _discount = value; }
        }


        private bool _disable;
        [Required]
        [DataMember(IsRequired = true)]
        public bool Disable
        {
            get { return _disable; }
            set { _disable = value; }
        }


        private DateTime? _lastRequestTime;
        [DataMember]
        public DateTime? LastRequestTime
        {
            get { return _lastRequestTime; }
            set { _lastRequestTime = value; }
        }
    }

    public enum BFAccountUsage : byte
    {
        ALL = 0,
        BETTING = 1,
        QUERY = 2
    }
}